## Replication Files for "Relaxing Assumptions, Improving Inference: Integrating Machine Learning and the Linear Regression" by Marc Ratkovic

A list of files in the replication package are below.

Note that results may change slightly due to running the code on different systems. The simulations and Enos analyses were run on a cluster while the Mattes and Weeks analysis were run on a local Mac OS.  In order to exactly replicate the results in the paper, use the saved R objects.  Note that while seeds are set for the analyses, results may differ slightly from system to system.

The version of PLCE used for these studies can be found at my github, https://github.com/ratkovic/PLCE/tree/APSR.  Additional packages used are called at the beginning of each script and can be downloaded from CRAN.

## Scripts ----

PLCE_sims.R: Script for a single run of the simulations from the paper  The script will produce results for all sample size and settings, saving results in an object named "object_xxx.Rda" where "xxx" is a random number.

Enos_Analysis.R: For replicating the Enos example.  The code needs to be run four separate times, for blacks/whites that are near/not near a demolished project.  Specification is given at the top of the script.

Mattes_Weeks.R: For replicating the Mattes and Weeks example.

Figs1and2_Ratkovic.R, Fig3_Ratkovic.R: For producing the figures in the main body.

SupplementalFigures_Fig1.R, SupplementalFigures_Fig2.R: For producing the first two figures in the Supplemental Materials

SimFiguresHOEalln.R: For producing figures showing the additional simulation results in the Supplemental Materials.

## Results Objects: ----

B1.Rda, B2.Rda, W1.Rda, W2.Rda: Objects with results from Enos_Analysis.R. Results are discussed in the Enos example.

MattesHOE.Rda: Object with results from Mattes and Weeks example.

simresults_newbody.Rda: Object with all simulation results, in both the body and Supplemental Material.

## Data:----

data.turnout.csv.zip: Data used for Enos example. A large csv, so must be unzipped.

mattesweeksAJPS.dta: Data used for the Mattes and Weeks example.

## Supplemental Materials: ----

SuppMaterialsFig1_Ratkovic.pdf: Supplemental Materials for the manuscript.
